package com.huabo.schedule;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Jackie Liu on 2017/8/2.
 */
public class ScheduleJob implements Serializable {
    /**
     * 任务ID
     */
    private Long jobId;

    /**
     * 任务名称
     */
    private String jobName;
    /**
     * 任务组id
     */
    private String jobGroupId = "_huabo_task_group_id_";
    /**
     * 任务分组
     */
    private String jobGroup = "_huabo_task_icip_";
    /**
     * 任务状态
     */
    private String jobStatus;
    /**
     * cron表达式
     */
    private String cronExpression;

    /**
     * 简单时间表达式
     */
    private Date simpleExpression;

    /**
     * 任务执行时调用哪个类 包名+类名
     */
    private String jobClassName;

    /**
     * 任务调用的方法名
     */
    private String jobMethodName;

    /**
     * 任务是否有状态(即并发执行同一个任务)
     */
    private boolean isConcurrent = false;

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroupId() {
        return jobGroupId;
    }

    public void setJobGroupId(String jobGroupId) {
        this.jobGroupId = jobGroupId;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }

    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    public Date getSimpleExpression() {
        return simpleExpression;
    }

    public void setSimpleExpression(Date simpleExpression) {
        this.simpleExpression = simpleExpression;
    }

    public String getJobClassName() {
        return jobClassName;
    }

    public void setJobClassName(String jobClassName) {
        this.jobClassName = jobClassName;
    }

    public String getJobMethodName() {
        return jobMethodName;
    }

    public void setJobMethodName(String jobMethodName) {
        this.jobMethodName = jobMethodName;
    }

    public boolean isConcurrent() {
        return isConcurrent;
    }

    public void setConcurrent(boolean concurrent) {
        isConcurrent = concurrent;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ScheduleJob{");
        sb.append("jobId='").append(jobId).append('\'');
        sb.append(", jobName='").append(jobName).append('\'');
        sb.append(", jobGroupId='").append(jobGroupId).append('\'');
        sb.append(", jobGroup='").append(jobGroup).append('\'');
        sb.append(", jobStatus='").append(jobStatus).append('\'');
        sb.append(", cronExpression='").append(cronExpression).append('\'');
        sb.append(", simpleExpression=").append(simpleExpression);
        sb.append(", jobClassName='").append(jobClassName).append('\'');
        sb.append(", jobMethodName='").append(jobMethodName).append('\'');
        sb.append(", isConcurrent=").append(isConcurrent);
        sb.append('}');
        return sb.toString();
    }
}
